#include "gwbase/base/timestamp.h"
#include "gwbase/base/test_harness.h"
#include <boost/bind.hpp>

using namespace dicom;

class TimestmapTest {};

TEST(TimestmapTest, Simple) {
  Timestamp now = Timestamp::Now();
  time_t t1 = now.ToTimeT();
  struct tm tm;
  ::gmtime_r(&t1, &tm);

  time_t t2 = ::timegm(&tm);
  EXPECT_Eq(t1, t2);
}

TEST(TimestmapTest, ISO8601) {
  Timestamp now = Timestamp::Now();
  std::string iso1 = now.ToISO8601();
  Timestamp now2 = Timestamp::FromISO8601(iso1);
  std::string iso2 = now2.ToISO8601();
  EXPECT_TRUE(iso1 == iso2);
  // EXPECT_TRUE(now == now2);
}

int main() {
  dicom::RunAllTests();
  return 0;
}
